*SHAIR-ROSENFIELD & STOYAN - GENDERED OPPORTUNITIES AND CONSTRAINTS - PRQ
*DO FILE CREATED BY ALISSANDRA T STOYAN ON 1.12.16
*LAST UPDATED: 1.8.18
 
cd "C:\Users\stoyan\Dropbox\Shair-Rosenfield & Stoyan docs\LA fem exec - PRQ\updated data folder"
use "shairrosenfield_stoyan_prq_datav13.dta", clear

*ANALYSIS
*************
xtset countryid qtr
set more off

*TABLE 1: PAIRWISE DIFFERENCE OF MEANS TESTS OF DECREE ISSUANCE
ttest decreecount if countryid==1, by(presgender)
ttest decreecount if countryid==2, by(presgender)
ttest decreecount if countryid==3, by(presgender)
ttest decreecount if countryid==4, by(presgender)
ttest decreecount, by(presgender)
	
*TABLE 2: ANALYSIS OF EXECUTIVE DECREE COUNT DATA
*MODEL 1
xtnbreg decreecount presgender lagapproval rulingcoalsize quartercount l.cpi, fe
*CALCULATING PERCENTAGE CHANGE - SEX
margins, predict (nu0) at (presgender=(0(1)1)) atmeans noatlegen
*CALCULATING PERCENTAGE CHANGE - PRES APPROVAL
margins, predict (nu0) at (lagapproval=(53.343(14.117)67.46)) atmeans noatlegen
*MODEL 2
xtnbreg decreecount i.presgender c.lagapproval rulingcoalsize quartercount l.cpi i.presgender#c.lagapproval, fe
	
*FIGURE 2
margins, predict(nu0) at (lagapproval=(20(5)85) presgender=(0(1)1)) atmeans noatlegen
marginsplot

*SUPPLEMENTAL MATERIAL
**************************

*TABLE A1: DESCRIPTIVE STATISTICS
su decreecount presgender lagapproval rulingcoalsize quartercount l.cpi

*TABLE A2: SEPARATE MODELS FOR ARGENTINA AND BRAZIL
drop if countryid==3 | countryid==4
set more off
*MODEL 1
xtnbreg decreecount presgender lagapproval rulingcoalsize quartercount l.cpi, fe
*MODEL 2
xtnbreg decreecount i.presgender c.lagapproval rulingcoalsize quartercount l.cpi i.presgender#c.lagapproval, fe

*FIGURE A1: Decree Issuance by Sex at Varying Levels of Lagged Executive Approval
margins, predict(nu0) at (lagapproval=(20(5)85) presgender=(0(1)1)) atmeans noatlegen
marginsplot
